package com.business.commons.date;

import java.text.SimpleDateFormat;
import java.util.Date;

public class DateFormat {

	/**
	 * 获取当前时间
	 * 
	 * @return
	 */
	public static String getCurrentTime() {
		SimpleDateFormat time = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		return time.format(System.currentTimeMillis());
	}

	/**
	 * 指定时间转换
	 * 
	 * @return
	 */
	public static String getTheTime(Date date) {
		SimpleDateFormat time = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		return time.format(date);
	}

	public static void main(String[] args) {
		String now = getTheTime(new Date());
		System.out.println(now);
	}
}
